/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.homesoft.catalogman.gui;

import com.homesoft.catalogman.entity.HmObjectMeta;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;

/**
 * @company Home
 * @author phucan
 * @createdDate Feb 3, 2015
 * @modifiedDate
 */
public class Test {

    public static void main(String[] args) {
        //Test Catalog 2
        Test t = new Test();
        t.showDialog();
        //Test Category_06
        //CustomDialog dlg=new CustomDialog(new Category_06() , null, true);
        //dlg.show(null);
    }

    public void showDialog() {
        EditorPane edt = new EditorPane();
        edt.setAction(new EditorPane.EditorAction() {

            @Override
            public boolean saveData() {
                JOptionPane.showConfirmDialog(null, "Save event");
                return true;
            }
        });
        CustomDialog dlg = new CustomDialog(edt, null, true);
        dlg.show(getFieldsMeta());
    }

    private List<HmObjectMeta> getFieldsMeta() {
        List<HmObjectMeta> lstMeta = new ArrayList<>();
        HmObjectMeta m1 = new HmObjectMeta(1, "Name", "Name", "Name", DataType.STRING, 0, 1, 0);
        HmObjectMeta m2 = new HmObjectMeta(1, "Age", "Age", "Age", DataType.INTEGER, 0, 1, 0);
        lstMeta.add(m1);
        lstMeta.add(m2);
        return lstMeta;
    }

}
